<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="th/m/include/head :: head(~{::title}, ~{::style})">
    <meta charset="utf-8">
    <title>嵌套表格-拉单</title>
    <style>
        .mui-input-group {
            background-color: #fff !important;
        }
        .mui-pull-top-canvas {
            display: none;
        }
        .mui-input-row .input-icon {
            width: 50%;
            float: left;
        }

        .mui-input-row a {
            margin-right: 10px;
            float: right;
            text-align: left;
            line-height: 1.5;
        }

        .search_div {
            height: 40px;
            border-bottom: 1px solid gainsboro;
            margin-left: 15px;
            vertical-align: middle;
        }

        .search_div select {

            color: #007aff;
            height: 37px;
        }

        .search_div label {

            color: #aaa;
        }
    </style>
</head>
<body>
<header class="mui-bar mui-bar-nav">
    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
    <h1 class="mui-title">嵌套表格-选择</h1>
    <a id='done' class="mui-btn mui-btn-link mui-pull-right mui-btn-blue ">完成</a>
</header>
<div id="pullrefresh" class="mui-scroll-wrapper" style="margin-top: 90px;">
    <div class="mui-scroll">
        <form class="search_form mui-input-group" id="search_content">

        </form>
        <!--数据列表-->
        <ul class="mui-table-view mui-table-view-chevron" id="ul_nest_sheet_choose_select">

        </ul>
    </div>
</div>
<script src="../../weixin/js/macro/open_window_macro.js"></script>
<script src="../../weixin/js/mui.module_list_sel.js"></script>
<script th:inline="javascript">
    var skey = [[${nav.skey}]];
    var parentFields = [[${parentFields}]];

    var params = {
        "parentId": [[${parentId}]],
        "formCode": [[${sFormCode}]],
        "orderBy": "id",
        "sort": "desc",
        "parentFormCode": [[${parentCode}]],
        "nestFieldName": [[${fieldCode}]],
        "nestType": "",
        "action": "afterGetClientValue",
        "skey": skey,
        "flowId": [[${flowId}]]
    };

    if (parentFields != "") {
        console.log("parentFields=" + parentFields);
        var par = JSON.parse(parentFields);
        for (var o in par) {
            params[o] = par[o];
            // console.log(o + "=" + params[o]);
        }
    }
    var options = {
        "isWx": [[${isWx}]],
        "ulContainer": "#ul_nest_sheet_choose_select",
        "ajax_params": params,
        "url": AJAX_REQUEST_URL.MODULE_LIST.NEST_SEL_LIST,
        "ajaxDatasType": LIST_TYPE.NEST_SHEET_CHOOSE_SELECT,
        "urlParams": '[(${urlParams})]'
    };

    // 使mui-scroll-wrapper可以滚动
    mui('.mui-scroll-wrapper').scroll({
        bounce: true, // 是否启用回弹
        indicators: true, //是否显示滚动条
        deceleration: 0.0006 //阻尼系数,系数越小滑动越灵敏，默认0.0006
    });

    var content = document.querySelector('#pullrefresh');
    var PullToRefrshListApi = new mui.PullToRefrshList(content, options);
    PullToRefrshListApi.loadListData();

    mui(".mui-bar").on("tap", ".mui-action-back", function () {
        if (options.isWx == 1) {
            nestSheetJump("请选择", "../macro/nestSheetSelect" + options.urlParams + "&isWx=1", "");
        } else {
            mui.back();
        }
    });
</script>
</body>
</html>
